package com.smartwebx.ha.web.admin.module.screen.group;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.smartwebx.ha.biz.assign.HaGroupManager;

public class AjaxTableGroup {
	@Autowired
	private HttpServletResponse response;
	@Autowired
	private HaGroupManager haGroupManager;

	public void execute() throws Exception {
		response.setContentType("application/json");
		PrintWriter out = response.getWriter();
		ObjectMapper mapper = new ObjectMapper();

		mapper.writeValue(out, haGroupManager.findAll());
	}
}